<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<input type="hidden" name="zh_parsen/fzr_name"
    value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>" />
<input type="hidden" name="zh_parsen/fzr_mobile"
    value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>" />
<input type="hidden" name="zh_parsen/fzr_tel"
    value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>" />
<input type="hidden" name="zh_parsen/fzr_email"
    value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>" />
<div class="t_bar">在孵企业基本情况</div>






<table class="t_css" width="100%" id="eq_table_01">
    <col style="width: 16%" />
    <col style="width: 17%" />
    <col style="width: 16%" />
    <col style="width: 17%" />
    <col style="width: 16%" />
    <col style="width: 18%" />

      <table class="t_css" width="100%" id="table_001">
		    <col style="width: 16%" />
		    <col style="width: 17%" />
		    <col style="width: 16%" />
		    <col style="width: 17%" />
		    <col style="width: 16%" />
		    <col style="width: 18%" />
    <tr>
        <td align="center"><span class="color_red">*</span>企业名称：</td>
        <td colspan="3">
            <input type='text' name='proposal/qy_title' id='qy_title' 
                class=" required" maxlength="50" style="width: 94%" 
                value='<x:out select="$xmlData/data/proposal/qy_title"/>' label="企业名称">
        </td>
        <td align="center"><span class="color_red">*</span>成立日期：</td>
        <td>
            <c:set var="hold_date">
                <x:out select="$xmlData/data/proposal/hold_date" />
            </c:set>
            <cpt:date id="hold_date_curr" name="proposal/hold_date" value="${hold_date}"
               className="required date " label="成立日期"></cpt:date>
        </td>
    </tr>
    
    
   <tr>      
    <td align="center"><span class="color_red">*</span>法人代表：</td>
        <td colspan="1">
      
                <input name="proposal/cname" label="法人代表" class="required input_text" maxlength="40"
                value="<x:out select="$xmlData/data/proposal/cname" />">
        </td>
        <td align="center"><span class="color_red">*</span>联系电话：</td>
        <td colspan="1">
           <input type="text" label="法人代表联系电话" name="proposal/contacts_mobile_hatched"
                class=" required" onfocus="InitInput.setNumber(this,15,0,0)"
                maxlength="15"
                value="<x:out select="$xmlData/data/proposal/contacts_mobile_hatched" />">
        </td>
        <td align="center"><span class="color_red">*</span>传真：</td>
        
        <td colspan="1">
            <input type="text" maxlength="11" name="proposal/fax" class="required" label="传真"
                value="<x:out select="$xmlData/data/proposal/fax" />">
        </td>      
   </tr>
   
   
    <tr>      
    <td align="center"><span class="color_red">*</span>注册资金(万元)：</td>
        <td colspan="1">
      <input type="text" label="注册资金" name="proposal/registered_capital_hatched"
                class=" " maxlength="50"  onfocus="InitInput.setNumber(this,9,2,2)"
                	style="text-align: right;"
                value="<x:out select="$xmlData/data/proposal/registered_capital_hatched" />">
        </td>
        <td align="center"><span class="color_red">*</span>法人代码：</td>
        <td colspan="1">
           <input type="text" label="法人代码" name="proposal/legal_code"
               class="required"  maxlength="11"   id="rogcode"
                value="<x:out select="$xmlData/data/proposal/legal_code" />">
        </td>
        <td align="center"><span class="color_red">*</span>入驻时间：</td>
        
        <td colspan="1">
 
            <c:set var="settled_date">
                <x:out select="$xmlData/data/proposal/settled_date" />
            </c:set>
            <cpt:date id="settled_date_curr" name="proposal/settled_date" value="${settled_date}"
               className="required date " label="入驻时间"></cpt:date>
        </td>      
   </tr>
   
   
   <tr>      
    <td align="center"><span class="color_red">*</span>联系人：</td>
        <td colspan="1">
      
                <input name="proposal/c_name" label="联系人" class="required input_text" maxlength="40"
                value="<x:out select="$xmlData/data/proposal/c_name" />">
        </td>
        <td align="center"><span class="color_red">*</span>联系电话：</td>
        <td colspan="1">
           <input type="text" label="联系人电话" name="proposal/contacts_phone_hatched"
                class=" required" onfocus="InitInput.setNumber(this,15,0,0)"
                maxlength="15"
                value="<x:out select="$xmlData/data/proposal/contacts_phone_hatched" />">
        </td>
        <td align="center"><span class="color_red">*</span>E-Mail：</td>
        
        <td colspan="1">
           <input type="text" label="E-Mail" name="proposal/contacts_email_c_name"
                class="required email" maxlength="50"
                value="<x:out select="$xmlData/data/proposal/contacts_email_c_name" />">
        </td>      
   </tr>
   
   
    <tr>
        <td align="center"><span class="color_red">*</span>注册地址：</td>
        <td colspan="3">
            <input type="text" label="注册地址" name="proposal/register_address"
                class="required "  maxlength="150" style="width: 94%"
                value="<x:out select="$xmlData/data/proposal/register_address" />">
        </td>
        <td align="center"><span class="color_red">*</span>邮编：</td>
        <td >
            <input type="text" label="邮编" name="proposal/contacts_postcode_hatched"
                class=" required" 
                maxlength="6"
                value="<x:out select="$xmlData/data/proposal/contacts_postcode_hatched" />">
        </td>
    </tr>
   
   
   <tr>
        <td align="center"><span class="color_red">*</span>从业人员情况：</td>
        <td colspan="5">
           <span>从业总人数：</span><input class="required " onfocus="InitInput.setNumber(this,11,0,0)" style="border:0px;border-bottom:#000000 1px solid;text-align: right;" type="text" id="congye_num" name="proposal/congye_num"  class="gray" maxlength="11" label="从业总人数"  value="<x:out select="$xmlData/data/proposal/congye_num" />"/>
            <span>人,</span>
           <span>其中大专以上学历</span><input class="required " onfocus="InitInput.setNumber(this,11,0,0)" style="border:0px;border-bottom:#000000 1px solid;text-align: right;" type="text" id="congye_num_college" name="proposal/congye_num_college" class="gray" maxlength="11" label="其中大专以上学历人数"  value="<x:out select="$xmlData/data/proposal/congye_num_college" />"/>
            <span>人.</span>
        </td>

    </tr>
   

     <tr >
        <td align="center"><span class="color_red">*</span>企业登记类型：</td>
        <td colspan="5"  align="center" >
             <c:set var="qiyedengji_nature"><x:out select="$xmlData/data/proposal/qiyedengji_nature" /></c:set>
			  <cpt:checkbox key="qiyedengji_nature" name="qiyedengji_nature"  value="${qiyedengji_nature }" width="80px;" repeatColumn="4" tagType="radio" ></cpt:checkbox>
		  	  <input type="hidden" id="qiyedengji_nature_value" name="proposal/qiyedengji_nature_value"  class="required"  value="<x:out select="$xmlData/data/proposal/qiyedengji_nature_value" />" label="企业登记类型">
		  	  <input type="hidden" name="proposal/qiyedengji_nature_name" value="<x:out select="$xmlData/data/proposal/qiyedengji_nature_name" />">
          		
        </td>   
    </tr>
    
    
     <tr >
        <td align="center"><span class="color_red">*</span>企业特性：</td>
        <td colspan="5"  align="center" >
             <c:set var="qiyetexing_nature"><x:out select="$xmlData/data/proposal/qiyetexing_nature" /></c:set>
			  <cpt:checkbox key="qiyetexing_nature" name="qiyetexing_nature"  value="${qiyetexing_nature }" width="80px;" repeatColumn="4" tagType="radio" ></cpt:checkbox>
		  	  <input type="hidden" id="qiyetexing_nature_value" name="proposal/qiyetexing_nature_value"  class="required"  value="<x:out select="$xmlData/data/proposal/qiyetexing_nature_value" />" label="企业特性">
		  	  <input type="hidden" name="proposal/qiyetexing_nature_name" value="<x:out select="$xmlData/data/proposal/qiyetexing_nature_name" />">
          		
        </td>   
    </tr>
    
    <tr>
        <td colspan="3" align="center">
           <span>企业上年度收入:</span><input class="required " onfocus="InitInput.setNumber(this,9,2,2)" style="border:0px;border-bottom:#000000 1px solid;text-align: right;" type="text" id="enterprises_receipts" name="proposal/enterprises_receipts" class="gray " maxlength="50" label="企业上年度收入"  value="<x:out select="$xmlData/data/proposal/enterprises_receipts" />"/>
            <span>万元</span>        
        </td>
        <td colspan="3" align="left">
           <span>专利数：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><input class="required " onfocus="InitInput.setNumber(this,11,0,0)"  style="border:0px;border-bottom:#000000 1px solid;text-align: right;" type="text" id="patents_number" name="proposal/patents_number" class="gray " maxlength="11" label="专利数"  value="<x:out select="$xmlData/data/proposal/patents_number" />"/>
            <span>项</span><br/>
           <span>其中发明专利：</span><input class="required "  onfocus="InitInput.setNumber(this,11,0,0)" style="border:0px;border-bottom:#000000 1px solid;text-align: right;" type="text" id="invent_patents_number" name="proposal/invent_patents_number" class="gray " maxlength="11" label="发明专利数"  value="<x:out select="$xmlData/data/proposal/invent_patents_number" />"/>
            <span>项</span>
        </td>
    </tr>
    
    <tr>  	
        <td colspan="6" align="left"><span class="color_red">*</span>企业经营范围及主导产品：（限5000字）</td>
    </tr>
    
  
      <tr>
        <td colspan="6">
            <textarea name="proposal/business_scope_brief" class="input_textarea required maxlength:5000"
                label="企业经营范围及主导产品" style="width: 98%"  rows="9"><x:out
                    select="$xmlData/data/proposal/business_scope_brief" /></textarea>
            <input type="hidden" name="proposal/business_scope_brief_hidden" value=""/>
        </td>
      </tr>
      

    </table>
  
     <table class="t_css" width="100%">
    <col style="width: 16%" />
    <col style="width: 17%" />
    <col style="width: 16%" />
    <col style="width: 17%" />
    <col style="width: 16%" />
    <col style="width: 18%" />
    <tr>  	
        <td colspan="6" align="center">承担国家、地方科技计划项目实施情况</td>
    </tr>
    </table>
   
     <table  id="eq_table100" class="t_css">
           <col style="width: 5%"/>
           <col style="width: 5%"/>
           <col style="width: 18%"/>
           <col style="width: 18%"/>
           <col style="width: 18%"/>
           <col style="width: 18%"/>
           <col style="width: 18%"/>
              
           <thead >
                   <tr >
                       <th class="TblHead" align="center">选择</th>
                       <th class="TblHead" align="center">序号</th>
                       <th class="TblHead" align="center">科技计划项目名称</th>
                       <th class="TblHead" align="center">项目类型</th>
                       <th class="TblHead" align="center">立项年度</th>
                       <th class="TblHead" align="center">支持金额(万元)</th>
                       <th class="TblHead" align="center">执行情况</th>                                           
                   </tr>
           </thead>
           <tbody id="tab">
                   <tr style="display:none;">
                       <td align="center">
                           <input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selMileStones" >
                       </td>
                       <td align="center">
                           <span name="team_persons|team_person[0]@seq_no" >[index]</span> 
                       </td>
                       <td align="center">
                           <input name="team_persons|team_person[0]|basic_info|science_name" style="width: 80%" label="科技计划项目名称" type="text" required class="input_text required" value="" maxlength="50"/>
                       </td>
                       
                       <td align="center">
                           <input name="team_persons|team_person[0]|basic_info|project_type" style="width: 80%" label="项目类型" type="text" required class="input_text required" value="" maxlength="50"/>
                       </td>                     
                       <td align="center">
                           <input name="team_persons|team_person[0]|basic_info|project_annual" style="width: 60%;text-align:right;"  onfocus="InitInput.setNumber(this,4,0,0)" label="立项年度" class="input_text required min:4"   maxlength="4" value=""/>
                       </td>
                       <td align="center">
                           <input name="team_persons|team_person[0]|basic_info|money"  onfocus="InitInput.setNumber(this,9,2,2)" style="width: 80%;text-align:right;" label="支持金额" type="text" required class="input_text required" value="" maxlength="20"/>
                       </td>
                       <td align="center">
                           <input name="team_persons|team_person[0]|basic_info|executive_condition" style="width: 80%" label="执行情况" type="text" required class="input_text required" value="" maxlength="20"/>
                       </td>
                      
                     
                   </tr>
                   
                   
                   <c:set value="0" var="index" scope="page"/>
                   <x:forEach select="$xmlData/data/team_persons/team_person" var="team_person">
                   
                   <c:choose>
                       <c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
                       <c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
                   </c:choose>
                   <tr >
                       <td align="center">
                           <input type="radio" style="border: 0px;background-color: white;" class="radiobutton" name="selMileStones" >
                       </td>
                       <td align="center">
                           <span name="team_persons/team_person[${flag}${index}]@seq_no"><x:out select="$team_person/@seq_no"/></span> 
                       </td>
                       
                       <td align="center">
                           <input name="team_persons/team_person[${flag}${index}]/basic_info/science_name" label="科技计划项目名称"  style="width: 80%" type="text" required class="input_text required" value="<x:out select="$team_person/basic_info/science_name"/>" maxlength="20"/>
                       </td>                       
                        <td align="center">
                           <input name="team_persons/team_person[${flag}${index}]/basic_info/project_type" label="项目类型"  style="width: 80%" type="text" required class="input_text required" value="<x:out select="$team_person/basic_info/project_type"/>" maxlength="20"/>
                       </td>
                  
                       <td align="center">
                           <input name="team_persons/team_person[${flag}${index}]/basic_info/project_annual" label="立项年度"  onfocus="InitInput.setNumber(this,4,0,0)" style="width: 60%;text-align:right;" type="text" required maxlength="4"   value="<x:out select="$team_person/basic_info/project_annual"/>"/>
                       </td>
                       <td align="center">
                           <input name="team_persons/team_person[${flag}${index}]/basic_info/money" onfocus="InitInput.setNumber(this,9,2,2)" label="支持金额" style="width: 80%;text-align:right;" type="text" required class="input_text required" value="<x:out select="$team_person/basic_info/money"/>" maxlength="20"/>
                       </td>
                       <td align="center">
                           <input name="team_persons/team_person[${flag}${index}]/basic_info/executive_condition" label="执行情况" style="width: 80%" type="text" required class="input_text required" value="<x:out select="$team_person/basic_info/executive_condition"/>" maxlength="20"/>
                       </td>
                      
                   </tr>
                   <c:set value="${index+1}" var="index" scope="page"/>
                   </x:forEach>
               </tbody>
      </table> 
      
       <table width="98%" align="center">
               <tr >
                   <td>
                       <input class="button_02" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('eq_table100',999,'承担国家、地方科技计划项目实施情况内容最多只能填写999条')){addNewRow('eq_table100');showDateTag('eq_table100');}try{top.resizeFrame();}catch(e){};">
                       <input class="button_02" name="cmdMovePrev" type=button value="上移" onclick="movePrev('eq_table100','selMileStones');">
                       <input class="button_02" name="cmdMoveNext" type=button value="下移" onclick="moveNext('eq_table100','selMileStones');">
                       <input class="button_02" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('eq_table100','承担国家、地方科技计划项目实施情况');">
                   </td>
               </tr>
       </table>
    
       
    
   
  
 </table>
 
 
<!-- <table width="98%" align="center">
               <tr >
                   <td>
                       <input class="button_02" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('eq_table_01',999,'承担国家、地方科技计划项目实施情况内容最多只能填写999条')){addNewRow('eq_table_01');showDateTag('eq_table_01');}try{top.resizeFrame();}catch(e){};">
                       <input class="button_02" name="cmdMovePrev" type=button value="上移" onclick="movePrev('eq_table_01','selMileStones1');">
                       <input class="button_02" name="cmdMoveNext" type=button value="下移" onclick="moveNext('eq_table_01','selMileStones1');">
                       <input class="button_02" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('eq_table_01','承担国家、地方科技计划项目实施情况');">
                   </td>
               </tr>
       </table> -->

 
<script type="text/javascript">

function getTotalCount(prefix,count,total,isDecimal){
	  var defaultIsDecimal = false;//默认为整数
	  if(isDecimal==null){
	        isDecimal = defaultIsDecimal;
	  }
	  var numStr = count.split(',');
	  var totalCount = 0;//总数	
	  if(!isDecimal){
	        for ( var int = 0; int < numStr.length; int++) {
	             var num = $('#'+prefix+numStr[int]).val();
	             if(!$.isNumeric(num))
	                  num = "0";
	             totalCount += parseInt(num);
	       }
	  }else {
	     for ( var int = 0; int < numStr.length; int++) {
	         var num = $('#'+prefix+numStr[int]).val();
	         if(!$.isNumeric(num))
	             num = "0";
	         totalCount += parseFloat(num);
	     }
	     totalCount = ((totalCount/100)*100).toFixed(2);
	  }
	  if(totalCount == 0){
	        $('#'+prefix+total).val("");
	  }else {
	        $('#'+prefix+total).val(totalCount);
	  }
	}
	function changeFhq(){
		if ($("input[id$='other04']").prop('checked')){
			$("input[id$='fuhuaqi_nature_other']").removeAttr("disabled");
			$("input[id$='fuhuaqi_nature_other']").removeAttr("class");
			$("input[id$='fuhuaqi_nature_other']").attr("class","required");
		}else{
	 		$("input[id$='fuhuaqi_nature_other']").attr("disabled","disabled");
	 		$("input[id$='fuhuaqi_nature_other']").attr("class","gray");
			$("input[id$='fuhuaqi_nature_other']").val(" ");
		}
	}

	function initTreeValueExt(treeId, treeNode) {
	 	if ((treeNode && treeNode.isParent)) {
	 		scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
	 		$("#" + treeId).val("");
	 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
	 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId	+ "_value']").val("");
	 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
	 		return false;
	 	}
	 	var str = treeNode.name;
	 	var obj = treeNode.parentNode;
	 	while (obj != null) {
	 		str = obj.name + "-" + str;
	 		obj = obj.parentNode;
	 	}
	 	
	 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
	 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
	 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
	}


	function initControlValue(objId){
	    
	    var name="";
	    var obj=$("#"+objId);
	    if(obj.is("select")){
	        name=obj.attr("name");
	        obj.parent().children("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).find("option:selected").val());
	        $("#"+objId).parent().children("input[name$='"+name+"_name']").val($("#"+objId).find("option:selected").text());
	    }
	   
	    else if(obj.is(":radio")){
	        name=obj.attr("name");
	        if(obj.is(":checked")){//如果被选中
	            //alert($("#"+objId).val());        
	            obj.parents("table").find("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).val());
	            $("#"+objId).parent().children("input[name$='"+name+"_name']").val($("#"+objId).next().text());
	        }
	        else{
	            
	            obj.parents("table").find("input[name$='"+name+"_value'][type='hidden']").val("");
	        }
	    }else if(obj.is(":checkbox")){
	        name=obj.attr("name");
	        if(obj.is(":checked"))//如果被选中
	            obj.parent().find("input[name$='"+name+"_value'][type='hidden']").val($("#"+objId).val());
	        else
	            obj.parent().find("input[name$='"+name+"_value'][type='hidden']").val("");
	    }else{
	        name=obj.attr("id");
	        obj.parents("td").find("input[name$='"+name+"_name'][type='hidden']").val(obj.val());
	        obj.parents("td").find("input[name$='"+name+"_code'][type='hidden']").val($("#"+objId+"_hideId").val());
	    }   
	}




$('#topic_level1_year1_count,#topic_level1_year2_count,#topic_level1_year3_count').change(function(){
	getTotalCount('topic_level1_','year1_count,year2_count,year3_count','total_count',false);
});
$('#topic_level1_year1_fund,#topic_level1_year2_fund,#topic_level1_year3_fund').change(function(){
	getTotalCount('topic_level1_','year1_fund,year2_fund,year3_fund','total_fund',true);
});
$('#topic_level2_year1_count,#topic_level2_year2_count,#topic_level2_year3_count').change(function(){
	getTotalCount('topic_level2_','year1_count,year2_count,year3_count','total_count',false);
});
$('#topic_level2_year1_fund,#topic_level2_year2_fund,#topic_level2_year3_fund').change(function(){
	getTotalCount('topic_level2_','year1_fund,year2_fund,year3_fund','total_fund',true);
});
$('#topic_level3_year1_count,#topic_level3_year2_count,#topic_level3_year3_count').change(function(){
	getTotalCount('topic_level3_','year1_count,year2_count,year3_count','total_count',false);
});
$('#topic_level3_year1_fund,#topic_level3_year2_fund,#topic_level3_year3_fund').change(function(){
	getTotalCount('topic_level3_','year1_fund,year2_fund,year3_fund','total_fund',true);
});

/*
----------------------by zk
        描述：计算数值总数
        参数prefix：公共的id开头
        参数count：需要加的数的id结尾     以,分割
        参数total：总数id结尾
        参数isDeciaml：是否为小数 默认为false
*/


</script>	